<template>
  <div>
    <p>首页</p>
    <div>
      <router-link to="/fy1" class="abc">
        <van-button type="info">分页1</van-button>
      </router-link>
      <router-link to="/fy2" class="abc">
        <van-button type="info">分页2</van-button>
      </router-link>
      <router-link to="/fy3">
        <van-button type="info">分页3</van-button>
      </router-link>
    </div>
    <br />
    <br />
    <van-button type="danger" @click="btn">点击随机</van-button>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: ["/fy1", "/fy2", "/fy3"],
    };
  },
  // Math.floor(Math.random() * 10)
  methods: {
    btn() {
      this.$router.push(
        this.list[Math.floor(Math.random() * this.list.length)]
      );
    },
  },
};
</script>

<style>
.abc {
  margin-right: 10px;
}
</style>